package com.kayt.cyberBar.company.business.service.impl;

import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.common.base.BaseDaoService;
import com.kayt.cyberBar.common.base.BaseService;
import com.kayt.cyberBar.common.utils.StringUtils;
import com.kayt.cyberBar.company.business.dao.impl.CompanyDealerDaoImpl;
import com.kayt.cyberBar.company.business.entity.po.BCompanyDealer;
import com.kayt.cyberBar.company.business.entity.vo.CompanyDealerVO;
import com.kayt.cyberBar.company.business.service.ICompanyDealerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description
 *
 * @author Kevin
 * @since 12/27/2017 17:16
 */
@Service
public class CompanyDealerServiceImpl extends BaseService<BCompanyDealer,CompanyDealerVO> implements ICompanyDealerService {
    @Autowired
    private CompanyDealerDaoImpl companyDealerDao;
    @Override
    public BaseDaoService<BCompanyDealer> getDaoService() {
        return companyDealerDao;
    }

    @Override
    public long getID(CompanyDealerVO vo) {
        return vo.getId();
    }

    @Override
    public ServerResponse save(CompanyDealerVO info) {
        info.setCode(StringUtils.uuid());
        return super.save(info);
    }
}
